package brosim.bean;

import java.util.ArrayList;
import java.util.Collection;
import java.util.Iterator;

public class Card {
    private int id = 0;
    private String name;
    private String group;
    private int atk;
    private int def;
    private int perDef;
    private int atkM;
    private int defM;
    private int perDefM;
    private Collection bonus = new ArrayList();
    private Collection skills = new ArrayList();
    
    /** Creates a new instance of Card */
    public Card() {
        
    }
    
    public Card(int id, String name, String group, int atk, int def, int def2, int atkm, int defm, int defM2, Collection bonus, Collection skills) {
        super();
        // TODO Auto-generated constructor stub
        this.id = id;
        this.name = name;
        this.group = group;
        this.atk = atk;
        this.def = def;
        perDef = def2;
        atkM = atkm;
        defM = defm;
        perDefM = defM2;
        this.bonus = bonus;
        this.skills = skills;
    }
    
    public int getAtk() {
        return atk;
    }
    
    public int getAtkM() {
        return atkM;
    }
    
    public Collection getBonus() {
        return bonus;
    }
    
    public int getDef() {
        return def;
    }
    
    public int getDefM() {
        return defM;
    }
    
    public String getGroup() {
        return group;
    }
    
    public int getId() {
        return id;
    }
    
    public String getName() {
        return name;
    }
    
    public int getPerDef() {
        return perDef;
    }
    
    public int getPerDefM() {
        return perDefM;
    }
    
    public Collection getSkills() {
        return skills;
    }
    
    public void setAtk(int atk) {
        this.atk = atk;
    }
    
    public void setAtkM(int atkM) {
        this.atkM = atkM;
    }
    
    public void setBonus(Collection bonus) {
        this.bonus = bonus;
    }
    
    public void setDef(int def) {
        this.def = def;
    }
    
    public void setDefM(int defM) {
        this.defM = defM;
    }
    
    public void setGroup(String group) {
        this.group = group;
    }
    
    public void setId(int id) {
        this.id = id;
    }
    
    public void setName(String name) {
        this.name = name;
    }
    
    public void setPerDef(int perDef) {
        this.perDef = perDef;
    }
    
    public void setPerDefM(int perDefM) {
        this.perDefM = perDefM;
    }
    
    public void setSkills(Collection skills) {
        this.skills = skills;
    }
    
    public double getBonusValue(int id) {
        double value = 0;
        Iterator i = bonus.iterator();
        while (i.hasNext()) {
            int[] b = (int[])i.next();
            if (b[0] == id) {
                value += b[1];
            }
        }
        return value;
    }
    
}
